package Alarm;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.mnk.TCPsoketTest.R;

import dietAndroidClient.CalendarView;

public class NotificationRun extends Service implements OnClickListener{
	
	
	@Override
	public void onCreate(){
		
		//Thread thr = new Thread(null,mTask,"AlarmService_Service");
		//thr.start();
		
	}
	

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
	
	 private PendingIntent makeMoodIntent(int moodId) {
			// The PendingIntent to launch our activity if the user selects this
			// notification. Note the use of FLAG_UPDATE_CURRENT so that if there
			// is already an active matching pending intent, we will update its
			// extras to be the ones passed in here.
			PendingIntent contentIntent = PendingIntent.getActivity(this,0,	
					new Intent(this, Alarm.NotificationDisplay.class).setFlags(
							Intent.FLAG_ACTIVITY_NEW_TASK).putExtra("moodimg",
							moodId), PendingIntent.FLAG_UPDATE_CURRENT);
			return contentIntent;
		}
	 
	 private void setDefault(int defaults) {
		 Log.i("notirun","goodruninggggggggggggg");
	        // This method sets the defaults on the notification before posting it.
	        
	        // This is who should be launched if the user selects our notification.
	        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
	                new Intent(this, CalendarView.class), 0);

	        // In this sample, we'll use the same text for the ticker and the expanded notification
	        CharSequence text = getText(R.string.status_bar_notifications_happy_message);

	        final Notification notification = new Notification(
	                R.drawable.dieter_01,       // the icon for the status bar
	                text,                        // the text to display in the ticker
	                System.currentTimeMillis()); // the timestamp for the notification

	        notification.setLatestEventInfo(
	                this,                        // the context to use
	                getText(R.string.status_bar_notifications_mood_title),
	                                             // the title for the notification
	                text,                        // the details to display in the notification
	                contentIntent);              // the contentIntent (see above)

	        notification.defaults = defaults;
	        
	   //     mNotificationManager.notify(
	//                   R.layout.status_bar_notifications, // we use a string id because it is a unique
	                                                      // number.  we use it later to cancel the
	         //          notification);                     // notification
	    }

	@Override
	public IBinder onBind(Intent arg0) {
		// TODO Auto-generated method stub
		return null;
	}  
	 
	 

}
